<!DOCTYPE html >
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link th:href="@{/erp/assets/css/bootstrap.min.css}" rel="stylesheet"/>
    <link rel="stylesheet" th:href="@{/erp/css/style.css}"/>
    <link th:href="@{/erp/assets/css/codemirror.css}" rel="stylesheet">
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/font-awesome.min.css}"/>
    <!--[if IE 7]>
    <link rel="stylesheet" th:href="@{/erp/assets/css/font-awesome-ie7.min.css}"/>
    <![endif]-->
    <!--[if lte IE 8]>
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace-ie.min.css}"/>
    <![endif]-->
    <script th:src="@{/erp/assets/js/jquery.min.js}"></script>
    <!-- <![endif]-->
    <!--[if IE]>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <![endif]-->
    <!--[if !IE]> -->
    <script type="text/javascript">
        window.jQuery || document.write("<script th:src='@{/erp/assets/js/jquery-2.0.3.min.js}'>" + "<" + "/script>");
    </script>
    <!-- <![endif]-->
    <!--[if IE]>
    <script type="text/javascript">
        window.jQuery || document.write("<script th:src='@{/erp/assets/js/jquery-1.10.2.min.js}'>" + "<" + "/script>");
    </script>
    <![endif]-->
    <script type="text/javascript">
        if ("ontouchend" in document) document.write("<script th:src='@{/erp/assets/js/jquery.mobile.custom.min.js}'>" + "<" + "/script>");
    </script>
    <script th:src="@{/erp/assets/js/bootstrap.min.js}"></script>
    <script th:src="@{/erp/assets/js/typeahead-bs2.min.js}"></script>
    <!-- page specific plugin scripts -->
    <script th:src="@{/erp/assets/js/jquery.dataTables.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.bootstrap.js}"></script>
    <script th:src="@{/erp/assets/layer/layer.js}" type="text/javascript"></script>
    <script th:src="@{/erp/assets/laydate/laydate.js}" type="text/javascript"></script>
    <title>货区管理</title>
</head>
<body>
<div class="page-content clearfix">
    <div id="Member_Ratings">
        <div class="d_Confirm_Order_style">
            <div class="search_style">
                <form>
                    <ul class="search_content clearfix">
                        <li>
                            <label class="l_f">仓库名称</label>
                            <select name="wareId" id="select_wareName1" style="margin-left:10px;width:180px;">
                                <option value="">请选择仓库</option>
                            </select>
                        </li>
                        <li>
                            <label class="l_f">货区名称</label>
                            <select name="goodsName" id="select_goodsName" style="margin-left:10px;">
                                <option value="">请选择货区</option>
                            </select>
                        </li>
                        <li>
                            <label class="l_f">创建时间</label>
                            <input class="inline laydate-icon" name="deteTime" id="start" style=" margin-left:10px;">
                        </li>
                        <li style="width:90px;">
                            <button type="button" id="btn_search" class="btn_search"><i class="icon-search"></i>查询
                            </button>
                        </li>
                    </ul>
                </form>
            </div>
            <!---->
            <div class="border clearfix"><span class="l_f"> <a href="javascript:;" id="property_add" onclick="add(this)"
                                                               class="btn btn-warning"><i class="icon-plus"></i>新增货区</a> </span>
            </div>
            <!---->
            <div class="table_menu_list">
                <table class="table table-striped table-bordered table-hover" id="sample-table">
                    <thead>
                    <tr>
                        <th width="100px">序号</th>
                        <th width="120px">货区编号</th>
                        <th width="120px">货区名称</th>
                        <th width="120px">所属仓库</a></th>
                        <th width="120px">负责人</th>
                        <th width="120px">货架数目</th>
                        <th width="250px">描述</th>
                        <th width="180px">创建时间</th>
                        <th width="70px">状态</th>
                        <th width="200px">操作</th>
                        <th hidden="hidden"/>
                    </tr>
                    </thead>
                    <tbody>

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!--销售区域分配图层-->
<div class="add_menber" id="add_menber_style" style="display:none">
    <form id="form1">
    <ul class=" page-content">
        <div class="Operate_cont clearfix">
            <label class="form-label"><span class="c-red">*</span>仓库名称：</label>
            <div class="formControls ">
                <select name="wareName" id="select_ware"  style="margin-left:10px;">
                    <option value="">请选择仓库</option>
                </select>
            </div>
        </div>
        <div class="Operate_cont clearfix">
            <label class="form-label"><span class="c-red">*</span>货区编号：</label>
            <div class="formControls ">
                <input type="text" class="input-text" onblur="goodsNo()" value="" placeholder="" id="goods_no" name="货区编号">
            </div>
        </div>
        <div class="Operate_cont clearfix">
            <label class="form-label"><span class="c-red">*</span>货区名称：</label>
            <div class="formControls ">
                <input type="text" class="input-text" onblur="goodsName()" value="" placeholder="" id="goods_name" name="货区名称">
            </div>
        </div>
        <div class="Operate_cont clearfix">
            <label class="form-label"><span class="c-red">*</span>货架数目：</label>
            <div class="formControls " style="width:280px;">
                <input type="text" class="input-text" onblur="huojia()" value="" placeholder="" id="shelves_num" name="货架数目">
            </div>
        </div>
        <div class="Operate_cont clearfix">
            <label class="form-label"><span class="c-red">*</span>区域面积：</label>
            <div class="formControls ">
                <input type="text" class="input-text" onblur="mianji()" value="" placeholder="/平方米" id="area" name="区域面积">
            </div>
        </div>
        <div class="Operate_cont clearfix">
            <label class="form-label"><span class="c-red">*</span>创建时间：</label>
            <div class="formControls ">
                <input type="date" class="input-text" placeholder="yyyy-mm-dd" id="dete_time1" name="创建时间"/>
            </div>
        </div>
        <div class="Operate_cont clearfix">
            <label class="form-label"><span class="c-red"></span>货区描述：</label>
            <div class="formControls "><textarea id="dateils"></textarea>
            </div>
        </div>
    </ul>
    </form>
</div>
</div>
</div>
</div>
<!--编辑区域分配图层-->
<div class="edit_menber" id="edit_menber_style" style="display:none">
    <ul class=" page-content">
        <div class="Operate_cont clearfix">
            <div class="brand_detailed">
                <ul class="Info_style clearfix" style="width:510px; margin-top:0px;">
                    <li><label class="label_name">货区编号：</label> <span class="name"><input id="goodsNo" name="货区编号"
                                                                                          type="text" class="text_add"
                                                                                          style="width:140px;" value=""></span>
                    </li>
                    <li><label class="label_name">货区名称：</label><span class="name"><input id="goodsName" name="货区名称"
                                                                                         type="text" class="text_add"
                                                                                         style="width:140px;" value=""></span>
                    </li>
                    <li style="display: none"><label class="label_name">所属仓库：</label><span class="name"><input id="wareName" name="所属仓库"
                                                                                         type="text" class="text_add"
                                                                                         style="width:140px;" value=""></span>
                    </li>
                    <li style="display: none"><label class="label_name">负责人：</label> <span class="name"><input id="person" name="负责人" type="text"
                                                                                         class="text_add"
                                                                                         style="width:140px;" value=""></span>
                    </li>

                    <li><label class="label_name">货架数目：</label><span class="name"><input id="shelvesNum" name="货架数目"
                                                                                         type="text" class="text_add"
                                                                                         style="width:140px;" value=""></span>
                    </li>
                    <li><label class="label_name">所属仓库：</label><span class="name" id="cangku"></span></li>
                    <li><label class="label_name">负责人：</label><span class="name" id="fuzeren"></span></li>
                    <li><label class="label_name">创建时间：</label><span class="name" id="deteTime1"></span></li>
                    <li><label class="label_name">状态：</label><span class="name">正常</span></li>
                    <li class="b_Introduce"><label class="label_name">库区描述：</label><br/><span class="name"><textarea
                            id="details" cols="40" rows="8"></textarea></span></li>
                </ul>

            </div>
        </div>
    </ul>
</div>

</body>
</html>
<script>
    //正则表达式
    var test1 = /^(?=.*?[\u4E00-\u9FA5]){2,100}/;//不能少于2个字符，不能都是数字和字母，必须有汉字
    var test2 = /^[0-9]*$/;  //只能输入数字
    var test3 = /^[0-9]*$/;  //只能输入数字
    var arr = [test1, test2, test3];
    var arr1 = [test1, test2]
    //错误提示信息
    var arr2 = ["货区名称不正确", "货架数目只能输入数目", "区域面积请输入数目"];
    //添加表单的输入框id
    var arr4 = ["goods_name", "shelves_num", "area"];
    var arr5 = ["goodsName", "shelvesNum"];
    var goodsnonum = [];


    /* 查询编号集 */
    function add(eq) {
        goodsnonum = [];
        /* 验证编号是否重复 */
        $("#sample-table tr").each(function (n) {
            goodsnonum.push($(this).children("td:eq(1)").text());
        });
        console.log(goodsnonum);
    }

    /* 添加正则点击事件 */
    function goodsNo(){
        for(var i in goodsnonum){
            if (goodsnonum[i] == $("#goods_no").val()) {
                layer.msg("编号已经存在", {icon: 2, time: 2000});
            }
        }
    }

    function goodsName(){
        if(test1.test($("#goods_name").val())){
            return true;
        }else{
            layer.msg("货区名称由汉字，数字，字母组成", {icon: 2, time: 2000});
        }
    }
    function huojia(){
        if(test2.test($("#shelves_num").val())){
            return true;
        }else{
            layer.msg("货架数目只能输入数目", {icon: 2, time: 2000});
        }
    }
    function mianji(){
        if(test3.test($("#area").val())){
            return true;
        }else{
            layer.msg("区域面积请输入数目", {icon: 2, time: 2000});
        }
    }


    /*添加货区*/
    $('#property_add').on('click', function () {
        var ware = [];
        $.ajax({
            url: '[[@{/warehouse/findallware}]]',
            success: function (d) {
                if(d.rs){
                    ware = d.data;
                    console.log(ware);
                    $('#select_ware').empty().append("<option>请选择仓库</option>")
                    for (var i in ware) {
                        $('#select_ware:last').append("<option value=" + ware[i].id + ">" + ware[i].wareName + "</option>")
                    }
                }else{
                    layer.msg("仓库列表加载失败", {icon: 2, time: 2000});
                }


            }
        })
        $("#form1")[0].reset();
        layer.open({
            type: 1,
            title: '添加货区',
            maxmin: true,
            shadeClose: true, //点击遮罩关闭层
            area: ['600px', ''],
            content: $('#add_menber_style'),
            btn: ['提交', '取消'],
            yes: function (index, layero) {
                var data = {};  //定义一个JQ对象
                data.wareId = $("#select_ware").val();
                data.goodsName = $("#goods_name").val();
                data.goodsNo = $("#goods_no").val();
                data.shelvesNum = $("#shelves_num").val();
                data.area = $("#area").val();
                data.deteTime1 = $("#dete_time1").val();
                data.details = $("#dateils").val();
                console.log(data);
                var num = 0;
                var str = "";

                /* 验证是否为空 */
                $(".add_menber input[type$='text']").each(function (n) {
                    if ($(this).val() == "") {
                        layer.alert(str += "" + $(this).attr("name") + "不能为空！\r\n", {
                            title: '提示框',
                            icon: 0,
                        });
                        num++;
                        return false;
                    }
                });
                if(num > 0){
                    return false;
                }

                /* 验证时间是否为空 */
                if ($("#dete_time1").val() == '') {
                    layer.alert(str += "" + $("#dete_time1").attr("name") + "不能为空！\r\n", {
                        title: '提示框',
                        icon: 0,
                    });
                    return false;
                }

                /* 验证编号是否存在 */
                for(var i in goodsnonum){
                    if (goodsnonum[i] == $("#goods_no").val()) {
                        layer.msg("仓库编号已经存在", {icon: 2, time: 2000});
                        num++;
                    }
                }
                if(num > 0){
                    return false;
                }

                //循环验证表单
                for (var i in arr) {
                    if (!arr[i].test($("#" + arr4[i] + "").val())) {
                        $("#" + arr4[i] + "").css("border", "1px solid #f00");
                        layer.msg(arr2[i], {icon: 2, time: 1000});
                        num++;
                        return false;
                    }
                }
                if(num > 0){
                    return false;
                }

                /* 获取下拉框的值 */
                var xiala = $("#select_ware").val();
                if (xiala == "" ) {
                    if(ware.length == 0){
                        layer.msg("这个公司很穷，还没有任何仓库，请取消货区创建", {icon: 2, time: 2000});
                        num++;
                        return false;
                    }else{
                        layer.msg("下拉框不能为空", {icon: 2, time: 2000});
                        num++;
                        return false;
                    }

                }
                if(num > 0){
                    return false;
                }
                /* 查询仓库货区是否已满 */
                $.ajax({
                    url: '[[@{/cargoarea/cargoNum}]]',
                    data: {
                        wareId : $("#select_ware").val(),
                    },
                    success: function (d) {
                        if(d.rs){
                            var data1 = d.data;
                            console.log(data1);
                            if(data1[0] > data1[1]){
                                /* 成功 */
                                if (num > 0) {
                                    return false;
                                } else {
                                    layer.alert('添加成功！', {
                                        title: '提示框',
                                        icon: 1,
                                    });
                                    $.ajax({
                                        url: '/cargoarea/addcargoarea',
                                        type: 'post',
                                        contentType: "application/json",
                                        data: JSON.stringify(data),
                                        success: function (d) {
                                            layer.close(index);
                                            window.parent.document.getElementById('iframe').contentWindow.location.reload(true);
                                        }
                                    })
                                }
                            }else{
                                layer.msg("此仓库货区已达上限", {icon: 2, time: 2000});
                                return false;
                            }
                        }else{
                            layer.msg("货区数目查询失败", {icon: 2, time: 2000});
                        }

                    }
                })
            }
        });
    });

    /* 修改点击事件 */
    /*function goodsName(){
        if(test1.test($("#goodsName").val())){
            return true;
        }else{
            layer.msg("货区名称由汉字，数字，字母组成", {icon: 2, time: 2000});
        }
    }
    function shelvesNum(){
        if(test2.test($("#shelvesNum").val())){
            return true;
        }else{
            layer.msg("货架数目只能输入数目", {icon: 2, time: 2000});
        }
    }
    function area(){
        if(test3.test($("#area").val())){
            return true;
        }else{
            layer.msg("区域面积请输入数目", {icon: 2, time: 2000});
        }
    }*/

    /*区域分配-编辑*/
    function update(eq) {
        goodsnonum = [];
        /* 验证编号是否重复 */
        $("#sample-table tr").each(function (n) {
            goodsnonum.push($(this).children("td:eq(1)").text());
        });
        console.log(goodsnonum);


        var AAA = $(eq).parent().parent().children("td:eq(1)").text();//没修改之前的库区编号
        $("#goodsNo").val($(eq).parent().parent().children("td:eq(1)").text());//库区编号
        $("#goodsName").val($(eq).parent().parent().children("td:eq(2)").text());//库区名称
        $("#wareName").val($(eq).parent().parent().children("td:eq(3)").text());//所属仓库
        $("#person").val($(eq).parent().parent().children("td:eq(4)").text());//负责人
        $("#shelvesNum").val($(eq).parent().parent().children("td:eq(5)").text());//货架数目
        $("#details").val($(eq).parent().parent().children("td:eq(6)").text());//仓库描述
        $("#deteTime1").text($(eq).parent().parent().children("td:eq(7)").text());//创建时间
        $("#fuzeren").text($(eq).parent().parent().children("td:eq(4)").text());//负责人222
        $("#cangku").text($(eq).parent().parent().children("td:eq(3)").text());//负责人222
        layer.open({
            type: 1,
            title: '编辑货区',
            maxmin: true,
            shadeClose: false, //点击遮罩关闭层
            area: ['600px', ''],
            content: $('#edit_menber_style'),
            btn: ['保存', '取消'],
            yes: function (index, layero) {
                /!*  获取编辑框的内容 *!/
                var data = {};  //定义一个JQ对象
                data.id = $(eq).parent().parent().children("td:eq(10)").text();//仓库id
                data.goodsNo = $("#goodsNo").val();
                data.goodsName = $("#goodsName").val();
                data.wareName = $("#wareName").val();
                data.person = $("#person").val();
                data.shelvesNum = $("#shelvesNum").val();
                data.details = $("#details").val();
                data.deteTime = $("#deteTime1").val()
                console.log(data);

                var num = 0;
                var str = "";

                /* 查询是否为空 */
                $(".edit_menber input[type$='text']").each(function (n) {
                    if ($(this).val() == "") {
                        layer.alert(str += "" + $(this).attr("name") + "不能为空！\r\n", {
                            title: '提示框',
                            icon: 0,
                        });
                        num++;
                        return false;
                    }
                });

                /* 验证编号是否存在 */
                if($("#goodsNo").val() != AAA){
                    for(var j in goodsnonum){
                        if(goodsnonum[j] == $("#goodsNo").val()) {
                            layer.msg("编号已经存在", {icon: 2, time: 2000});
                            num++;
                        }
                    }
                }
                if(num > 0){
                    return false;
                }

                /* 验证表单其他内容 */
                for (var i in arr1) {
                    if (!arr1[i].test($("#" + arr5[i] + "").val())) {
                        $("#" + arr5[i] + "").css("border", "1px solid #f00");
                        layer.msg(arr2[i], {icon: 2, time:2000});
                        num++;
                        return false;
                    }
                }

                if (num > 0) {
                     return false;
                } else {
                     layer.alert('修改成功！', {
                     title: '提示框',
                     icon: 1,
                 });
                    $.ajax({
                       url: '/cargoarea/updatecargo',
                       type: 'post',
                       contentType: "application/json",
                       data: JSON.stringify(data),
                       success: function (d) {
                             layer.close(index);
                             window.parent.document.getElementById('iframe').contentWindow.location.reload(true);
                        }
                    })

                }
            }
        });
    }

    /* 货区下拉框点击事件 */
    $('#select_goodsName').on('click', function () {
        var data = {};  //定义一个JQ对象
        data.wareId = $("#select_wareName1").val();//仓库id
        /* 模糊查询下拉框（货区名称） */
        $.ajax({
            url: '[[@{/cargoarea/findAllCargo}]]',
            type: 'post',
            contentType: "application/json",
            data: JSON.stringify(data),
            success: function (d) {
                if(d.rs){
                    var data = d.data;
                    console.log(data);
                    $('#select_goodsName:last').empty();
                    for (var i in data) {
                        $('#select_goodsName:last').append("<option value=" + data[i].goodsName + ">" + data[i].goodsName + "</option>")
                    }
                }else{
                    layer.msg("货区查询失败", {icon: 2, time: 2000});
                }

            }
        })
    });

    /*分页列表及模糊查询*/
    $(function () {


        /* 模糊查询下拉框（仓库名称） */
        $.ajax({
            url: '[[@{/warehouse/findallware}]]',
            success: function (d) {
                if(d.rs){
                    var data = d.data;
                    console.log(data);
                    for (var i in data) {
                        $('#select_wareName1:last').append("<option value=" + data[i].id + ">" + data[i].wareName + "</option>")
                    }
                }else{
                    layer.msg("仓库列表加载失败", {icon: 2, time: 2000});
                }

            }
        })

        var table = $('#sample-table').dataTable({
            "autoWidth": false,
            searching: false,
            serverSide: true,   //开始服务器分页
            ajax: {
                url: '/cargoarea/cargo',
                type: 'post',
                data: function (d) {
                    var data = $('form').serialize();   //获取查询条件
                    var searchParame = {
                        start: d.start,
                        length: d.length,
                    };
                    data = data + '&' + $.param(searchParame);
                    return data;
                }
            },
            columns: [
                {
                    "data": "id", "createdCell": function (td, cellData, rowData, row, col) {
                        $(td).text(row + 1);
                    }
                },
                {"data": "goods_no"},
                {"data": "goods_name"},
                {"data": "ware_name"},
                {"data": "person"},
                {"data": "shelves_num"},
                {"data": "details"},
                {"data": "dete_time1"},
                {
                    "data": "status",
                    "className": "td-status",
                    "createdCell": function (td, cellData, rowData, row, col) {
                        if (cellData == '0') {
                            $(td).empty().append('<span class="label label-success radius">正常</span>')
                        }
                        if (cellData == '1') {
                            $(td).empty().append('<span class="label label-defaunt radius">正常</span>');
                        }
                    }
                },
                {
                    "data": "status",
                    "className": "td-manage",
                    "createdCell": function (td, cellData, rowData, row, col) {
                        if (cellData == '0') {
                            $(td).empty().append(
                                '<a title="编辑" id="aa" onclick="update(this)" class="btn btn-xs btn-success  property_edit" ><i class="icon-edit bigger-120"></i></a>');
                        }
                        if (cellData == '1') {
                            $(td).empty().append(
                                '<a title="编辑" id="aa" onclick="update(this)" class="btn btn-xs btn-defaunt  property_edit" ><i class="icon-edit bigger-120"></i></a>');
                        }
                    }
                },
                {"data": "id", "className": "hidden"},
            ]

        });
        $(function () {
            //$('table tr:not(:first)').remove();
            var len = $('table tr').length;
            for (var i = 1; i < len; i++) {
                $('table tr:eq(' + i + ') td:first').text(i);
            }

        });
        //搜索按钮事件
        $('#btn_search').click(function () {
            table.fnUpdate();
        })

        $('table th input:checkbox').on('click', function () {
            var that = this;
            $(this).closest('table').find('tr > td:first-child input:checkbox')
                .each(function () {
                    this.checked = that.checked;
                    $(this).closest('tr').toggleClass('selected');
                });

        });


        $('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});

        function tooltip_placement(context, source) {
            var $source = $(source);
            var $parent = $source.closest('table')
            var off1 = $parent.offset();
            var w1 = $parent.width();

            var off2 = $source.offset();
            var w2 = $source.width();

            if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) return 'right';
            return 'left';
        }
    })

    /*货区-创建*/
    function member_add(title, url, id, w, h) {
        layer_show(title, url + '#?=' + id, w, h);
    }

    /*货区-编辑*/
    function member_edit(title, url, id, w, h) {
        layer_show(title, url + '#?=' + id, w, h);
    }

    /*货区-停用*/
    function member_stop(obj, id) {
        var aa = $(obj).parent().parent().children("td:eq(10)").text();
        layer.confirm('确认要停用吗？', function (index) {
            $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" class="btn btn-xs " onClick="member_start(this,id)" href="javascript:;" title="启用"><i class="icon-ok bigger-120"></i></a>');
            $(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已停用</span>');
            $(obj).remove();
            var data = {};  //定义一个JQ对象
            data.id = aa;
            $.ajax({
                url: '/cargoarea/updatecargostatus1',
                type: 'post',
                contentType: "application/json",
                data: JSON.stringify(data),
                success: function (d) {
                    layer.msg('已停用!', {icon: 5, time: 1000});
                }
            })
        });
    }

    /*货区-启用*/
    function member_start(obj, id) {
        var aa = $(obj).parent().parent().children("td:eq(10)").text();
        layer.confirm('确认要启用吗？', function (index) {
            $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" class="btn btn-xs btn-success" onClick="member_stop(this,id)" href="javascript:;" title="停用"><i class="icon-ok bigger-120"></i></a>');
            $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已启用</span>');
            $(obj).remove();
            var data = {};  //定义一个JQ对象
            data.id = aa;
            $.ajax({
                url: '/cargoarea/updatecargostatus0',
                type: 'post',
                contentType: "application/json",
                data: JSON.stringify(data),
                success: function (d) {
                    layer.msg('已停用!', {icon: 6, time: 1000});
                }
            })
        });
    }

    /*货区-删除*/
    function member_del(obj, id) {
        layer.confirm('确认要删除吗？', function (index) {
            $(obj).parents("tr").remove();
            layer.msg('已删除!', {icon: 1, time: 1000});
        });
    }

    laydate.render({
        elem: '#start',
        type: 'datetime'
    });
</script>
